package wiki.zimo.domain;

import wiki.zimo.annotation.Column;
import wiki.zimo.annotation.ID;
import wiki.zimo.annotation.Table;

import java.util.Objects;

/**
 * @auther: 子墨
 * @datetime: 2018/11/7 11:30
 * @describe: 商品分类实体类
 */
@Table(value = "category")
public class Category {

    @ID(value = "cid")
    private String cid;

    @Column(value = "cname")
    private String cname;

    private int productCount;

    public int getProductCount() {
        return productCount;
    }

    public void setProductCount(int productCount) {
        this.productCount = productCount;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Category category = (Category) o;
        return Objects.equals(cid, category.cid) &&
                Objects.equals(cname, category.cname);
    }

    @Override
    public int hashCode() {

        return Objects.hash(cid, cname);
    }

    @Override
    public String toString() {
        return "Category{" +
                "cid='" + cid + '\'' +
                ", cname='" + cname + '\'' +
                '}';
    }
}
